<template>
  <view class="prod-items" :data-goodsId="item.id" @tap="toProdPage">
    <view class="hot-imagecont">
      <image
        :src="item.picture"
        class="hotsaleimg"
      />
    </view>
    <view class="hot-text">
      <view class="hotprod-text">
        {{ item.title }}
      </view>
      <view class="prod-text-info">
        <view class="price">
          <text
            class="deadline-price"
          >
            限时价
          </text>
          <text class="symbol">
            ￥
          </text>
          <text class="big-num">
            {{ wxs.parsePrice(item.price)[0] }}
          </text>
          <text class="small-num">
            .{{ wxs.parsePrice(item.price)[1] }}
          </text>
        </view>
      </view>

    </view>
  </view>
</template>
<script setup>
  const wxs = number()
  // eslint-disable-next-line no-unused-vars
  const props = defineProps({
    item: {
      type: Object,
      default: () => {
        return null
      }
    }
  })

  const toProdPage = (e) => {
    const goodsId = e.currentTarget.dataset.goodsId
    uni.navigateTo({
      url: '/pages/prod/prod?goodsId=' + goodsId
    })
  }
</script>

<style scoped lang="scss">
  @use './production.scss';
</style>
